﻿package app {
	
	import flash.display.MovieClip;
	import flash.text.TextField;
	import flash.events.Event;
	
	public class LetterBtn extends MovieClip {
		
		public var BtnTxt:TextField;
		public var Letter:String; // holds Letter value for use in MainKey
		public var upper:Boolean = false;
		
		public function LetterBtn(thisLetter:String):void{
			trace("Load Letter "+thisLetter);
			BtnTxt.text = thisLetter;
			Letter = thisLetter;
			this.addEventListener("shiftChange", changeShift, false, 0, true);
		}
		public function changeShift(evt:Event):void{
			trace("catch event listener " + Letter);
			if(!upper){
				Letter = Letter.toUpperCase();
				BtnTxt.text = Letter
			}
			else{
				Letter = Letter.toLowerCase();
				BtnTxt.text = Letter;
			}
			upper = !upper;
		}
		
	}
	
}